﻿using System.Collections.Generic;

namespace com.binance.client.model.enums
{
	public sealed class StopOrderOperator
	{
		/// <summary>
		/// GTE,greater than and equal (>=) ,LTE less than and equal (<=)
		/// </summary>
		public static readonly StopOrderOperator GTE = new StopOrderOperator("GTE", InnerEnum.GTE, "gte", "greater than and equal (>=)");
		public static readonly StopOrderOperator LTE = new StopOrderOperator("LTE", InnerEnum.LTE, "lte", "less than and equal (<=)");

		private static readonly IList<StopOrderOperator> valueList = new List<StopOrderOperator>();

		static StopOrderOperator()
		{
			valueList.Add(GTE);
			valueList.Add(LTE);
		}

		public enum InnerEnum
		{
			GTE,
			LTE
		}

		public readonly InnerEnum innerEnumValue;
		private readonly string nameValue;
		private readonly int ordinalValue;
		private static int nextOrdinal = 0;

		private string @operator;

		private string desc;

		internal StopOrderOperator(string name, InnerEnum innerEnum, string @operator, string desc)
		{
			this.@operator = @operator;
			this.desc = desc;

			nameValue = name;
			ordinalValue = nextOrdinal++;
			innerEnumValue = innerEnum;
		}

		public string Operator
		{
			get
			{
				return @operator;
			}
		}

		public string Desc
		{
			get
			{
				return desc;
			}
		}

		public static StopOrderOperator find(string @operator)
		{
			foreach (StopOrderOperator op in StopOrderOperator.values())
			{
				if (op.Operator.Equals(@operator))
				{
					return op;
				}
			}
			return null;
		}


		public static IList<StopOrderOperator> values()
		{
			return valueList;
		}

		public int ordinal()
		{
			return ordinalValue;
		}

		public override string ToString()
		{
			return nameValue;
		}

		public static StopOrderOperator valueOf(string name)
		{
			foreach (StopOrderOperator enumInstance in StopOrderOperator.valueList)
			{
				if (enumInstance.nameValue == name)
				{
					return enumInstance;
				}
			}
			throw new System.ArgumentException(name);
		}
	}

}